// vim:tabstop=4 shiftwidth=4 syntax=objc

#import <CoreLocation/CoreLocation.h>
#import "FTLocationSimulator.h"

@class NGLocationUpdatedDelegate;
@class RotatingNGLocation;
@class NGLocation;

/// Possible values for the accuracy setting of the GPS.
enum ACCURACY_ENUM
{
	HIGH_ACCURACY,			///< Best the device can provide. Default.
	MEDIUM_ACCURACY,		///< About 50m.
	LOW_ACCURACY,			///< 150m or more.
};

/// Required alias for enum.
typedef enum ACCURACY_ENUM ACCURACY;

//GPS H->msinan



//değişilik 3.33

/** Wraps and controlls the GPS collection of data.
 *
 * Holds the pointer to the real sqlite object and provides additional
 * wrapper helper functions to handle the database.
 */
// ucuncu degisiklik
@interface GPS : NSObject <CLLocationManagerDelegate>
{
	/// Pointer to the manager activating/desactivating Core Location.
	//CLLocationManager *manager_;
#ifdef FAKE_CORE_LOCATION
    FTLocationSimulator *manager_;
#else
    CLLocationManager *manager_;
#endif   


	/// Last received position.
	CLLocation *last_pos_;

	BOOL gps_is_on_;

	/// Watchdog timer to detect GPS entering into zombie state.
	NSTimer *zasca_;

	/// Set this to YES if you want to avoid logging by the GPS class.
	BOOL nolog_;

	/// Current accuracy setting.
	ACCURACY accuracy_;
    id locationUpdatedDelegate;
    
    RotatingNGLocation *LAST_N_LOCATIONS;

    
}

@property (nonatomic, retain, readonly) CLLocation *last_pos;
@property (nonatomic, readonly, assign) BOOL gps_is_on;
@property (nonatomic, readonly, assign) ACCURACY accuracy;
@property (nonatomic, retain) id locationUpdatedDelegate;
@property (nonatomic, readonly, assign) RotatingNGLocation *LAST_N_LOCATIONS;


+ (GPS*)get;
+ (NSString*)degrees_to_dms:(CLLocationDegrees)value latitude:(BOOL)latitude;
+ (NSString*)key_path;
- (id)init; //location manager is self
- (id)init:(id) locationManagerDelegate;
- (bool)start;
- (void)stop;
- (void)add_watcher:(id)watcher;
- (void)remove_watcher:(id)watcher;
- (void)set_accuracy:(ACCURACY)accuracy reason:(NSString*)reason;
- (void)setGps_is_on:(BOOL)value;
- (void)sendLocationToServer:(NGLocation *)location;
- (void)setLAST_N_LOCATIONS:(RotatingNGLocation *)rLocations;

+ (RotatingNGLocation *) getLastNLocations;


@end
